[gfx1250][FlyDSL] Unify&Rename GEMM kernels and refactor LDS load - #4527
Merged
Merged
Conversation
aoli26
force-pushed
the
gfx1250/flydsl-unify-0803
branch
from
August 3, 2026 07:57
fc96d75 to
13fbfae
Compare
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR consolidates gfx1250 FlyDSL a8w8 GEMM kernels into a single unified implementation, renames the gfx1250 “blockscale” bpreshuffle path to “mxfp8_128”, and refactors gfx1250 LDS load/store helpers to use a shared copy-atom utility.
Changes:
- Unified gfx1250 FlyDSL a8w8 preshuffle kernels (PTPC + mxfp8_128) under
launch_gemm_a8w8(..., is_bsc=...)and updated call sites. - Renamed the FlyDSL gfx1250 “blockscale bpreshuffle” kernel family/prefix to
mxfp8_128and updated tuned kernelName parsing + AOT compilation logic. - Replaced raw LDS load/store helpers with
make_lds_copy_ops()and removed now-unused helper modules.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| aiter/ops/gemm_op_a8w8.py | Updates gfx1250 FlyDSL dispatch and renames the bpreshuffle FlyDSL entrypoint to mxfp8_128. |
| aiter/ops/flydsl/mxfp8_128_bpreshuffle_gemm_gfx1250.py | Switches to unified launcher, renames public dispatch helpers, and updates kernelName prefix parsing. |
| aiter/ops/flydsl/kernels/pipeline_utils.py | Removes shared pipeline utility module (no longer referenced). |
| aiter/ops/flydsl/kernels/mxfp4_preshuffle_gfx1250_tdm.py | Migrates LDS load/store usage to make_lds_copy_ops() helpers. |
| aiter/ops/flydsl/kernels/gfx1250_cluster.py | Removes vendored cluster MCAST helper module (no longer referenced). |
| aiter/ops/flydsl/kernels/gemm_common_gfx1250.py | Replaces raw LLVM LDS helpers with make_lds_copy_ops() and trims unused exports. |
| aiter/ops/flydsl/kernels/gemm_a8w8_ptpc_gfx1250.py | Removes the standalone PTPC kernel (functionality moved into unified kernel). |
| aiter/ops/flydsl/kernels/gemm_a8w8_gfx1250.py | Introduces unified gfx1250 a8w8 preshuffle kernel with is_bsc compile-time selection and refactored LDS reads. |
| aiter/ops/flydsl/gemm_tune/flydsl_gemm_mxfp8_128_bpreshuffle_wmma_common.py | Renames candidate kernel prefix and related helpers to mxfp8_128. |
| aiter/ops/flydsl/bpreshuffle_gemm_gfx1250.py | Updates PTPC runtime wrapper to call unified launcher with is_bsc=False. |
| aiter/configs/model_configs/dsv4_a8w8_blockscale_bpreshuffle_tuned_gemm.csv | Updates tuned gfx1250 FlyDSL kernelName entries to the new mxfp8_128 prefix. |
| aiter/aot/flydsl/gemm.py | Updates AOT parsing/compilation routing for the renamed mxfp8_128 kernel family and unified launcher. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
coderfeli
approved these changes
Aug 3, 2026
yanboshao
added a commit
that referenced
this pull request
Aug 4, 2026
…to updated main Reapply the gfx1250 fused-MoE ep_scatter feature (combine_mode="scatter_fused": gemm2's TDM epilogue P2P-writes each route-weighted output row into peers' comb_inp, so combine just sums -- no gather-reduce) onto the updated origin/main, which meanwhile landed #4482 (real SiTUv2 + >512-expert chunked psum scan), #4527 (LDS API refactor: lds_*_raw -> make_lds_copy_ops) and #4463 (fused_moe SiTUv2 path). Squashed to a single commit. Per-file resolution: - dispatch_combine_v2/*: vendored cco-LSA v2 intranode dispatch/combine op-layer. - mxfp4_preshuffle_gfx1250_tdm.py: on upstream's make_lds_copy_ops LDS API + SiTUv2 epilogue, add the TDM gather-store ep epilogue (tdm_scatter with in-kernel global_view/lds_view). tdm_scatter is vendored locally (tdm_gather_shim.py, on the stock FlyDSL wheel's low-level TDM intrinsics) so this branch needs no FlyDSL-side patch; route weight hoisted per wm row (_wf_rows). - moe_contiguous_psum.py: adopt upstream's chunked scan (E>512 correct) for the non-EP remap; keep the multi-block grid-stride remap + ep_rowmap kernels for EP. - grouped_moe_gfx1250.py: keep upstream SiTUv2 (stage1_act=3, situ_beta); add the ep_scatter dispatch wiring (ep_rowmap build, _ep_gemm2_kwargs, ep_scatter return). - batched_gemm_mxfp4.py / fused_moe.py: thread both situ_* and ep_* params. - tuned_grouped_fmoe.csv: tuning points (99 rows). Dropped only the full-subtile PF prefetch pipeline (da8d794): loaders and lds_addr_keepalive stay at upstream. lalala-sh's ds-read hoist is kept. gfx1250-only; not run in this environment. Compile-verify the LDS-API migration + ep/SiTUv2 epilogue and re-run test_mega_moe --combine on hardware. Co-authored-by: lalala-sh <Jiaxing.Wen@amd.com> Co-authored-by: zhimding <zhimding@amd.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Unify the FlyDSL GEMM kernels for gfx1250 into one implementation to remove code duplication. Rename blockscale to mxfp8_128. Refactor LDS load in gemm_common, and clean some useless codes.
Technical Details
Merge
gemm_a8w8_ptpc_gfx1250.pyandgemm_a8w8_blockscale_gfx1250.pyinto a singlelaunch_gemm_a8w8ingemm_a8w8_gfx1250.py, selected via a newis_bsccompile-time flag, and update all call sites accordingly.Test Plan
Ran
op_tests/test_gemm_a8w8.pyandop_tests/test_gemm_a8w8_blockscale.pyon gfx1250.Test Result
All tests pass with no accuracy or performance regression.
Submission Checklist